
import { createRouter ,createWebHistory } from 'vue-router' ;

const routes = [
    {
        path: '/' ,
        name: 'root' ,
        redirect: '/book/add'
    },
    { 
        path: '/book/add' ,
        name: 'bookAdd' ,
        component: ()=> import('@/components/BookAdd.vue')
    },
    { 
        path: '/book/list' ,
        name: 'bookList' ,
        component: ()=> import('@/components/BookList.vue')
    },
    { 
        path: '/book/edit' ,
        name: 'bookEdit' ,
        component: ()=> import('@/components/BookEdit.vue')
    },
    { 
        path: '/sign/up' ,
        name: 'signUp' ,
        component: ()=> import('@/components/SignUp.vue')
    },
    { 
        path: '/sign/in' ,
        name: 'signIn' ,
        component: ()=> import('@/components/SignIn.vue')
    },
    { 
        path: '/sign/out' ,
        name: 'signOut' ,
        component: ()=> import('@/components/SignOut.vue')
    }
];

const options = {
    routes,
    history: createWebHistory()
}

const router = createRouter( options );

// 导出 router 对象
export default router ;